<html lang="en" xmlns:th="http://www.thymeleaf.org">
<link href="css/show.css" rel="stylesheet"/>
<script src="js/jquery-3.4.1.js"></script>
<script src="layui/layui.js"></script>


<!--<script>-->
	<!--//获取项目路径-->
	<!--var pathName = window.location.pathname;-->
	<!--var projectName = pathName.substring(0, pathName.substr(1).indexOf('/') + 1);-->
	<!--//加载窗体-->
	<!--layui.use(['layer','form'], function(){-->
		<!--var layer=layui.layer;-->
		<!--var form=layui.form;-->
		<!--var $=layui.$;-->
  <!---->
		<!--$("#add").click(function(){-->
			<!--layer.open({-->
				<!--type: 1, -->
				<!--title:"添加分类",-->
				<!--area:['40%','35%'],-->
				<!--btn: ['确定', '取消'], -->
				<!--content: $("#window"),-->
				<!--yes:function(index,layero){-->
					<!--$.getJSON(projectName+'/addtype?methodName=addBook',{-->
						<!--typename: $('#typename').val()-->
					<!--},function(data){-->
					<!--//根据后台返回的参数，来进行判断-->
						<!--if(data>0){-->
							<!--layer.alert('增加成功',{icon:1,title:'提示'},function(i){-->
								<!--layer.close(i);-->
									<!--layer.close(index);//关闭弹出层-->
							<!--})-->
						<!--}-->
					<!--});-->
				<!--}-->
			<!--}); -->
		<!--});-->
	<!--})-->
<!--</script>-->

<div class="blog">
	<!-- ----------top----------- -->
	<div class="blog-p">
		<form action="/blogmanagebypage">
			<p>标题：</p>
			<input type="text" name="keyWords" th:value="${keyWords}"/>
			<input type="submit" id="search-btn" value="搜索"/>
		</form>
	</div>
	<!-- ---------标题栏---------- -->
	<div class="blog-title">
		<ul>
			<li>Id</li>
			<li>标题</li>
			<li>所属分类</li>
			<li>发布日期</li>
			<li>最近修改</li>
			<li>访问量</li>
			<li>操作</li>
		</ul>
	</div>
	<!-- ----------内容----------- -->
	<div class="blog-content">
		<ul th:each="blog:${pageInfo.list}">
			<li th:text="${blog.getId()}">测试Id1</li>
			<li><a href="#" th:text="${blog.getBtitle()}">我不是标题1</a></li>
			<li>
				<span th:each="type:${blog.getTypeList()}" style="margin: 0 3px;"><a th:href="@{/blogmanagebypage(pageNum=1,checkType=${type.getId()})}" th:text="${type.getTname()}">分类一</a></span>
			</li>
			<li th:text="${blog.getCreatetime()}">2021-06-13 21:02:01</li>
			<li th:text="${blog.getUpdatetime()}">2021-06-13 21:02:01</li>
			<li th:text="${blog.getPageview()}">0</li>
			<li>
				<span><a th:href="@{/toupdate(bid=${blog.getId()})}">修改</a></span>
				<span><a th:href="@{/deleteblog(bid=${blog.getId()})}" id="deleteblog" onclick="alert('确认删除？')">删除</a></span>
			</li>
		</ul>
		<!--  -->

	</div>
	<!-- ------bottom(分页)------ -->
	<div class="blog-bottom">
		<div class="blog-page">
			<span><a th:href="@{/blogmanagebypage(pageNum=1,checkType=${checkType},keyWords=${keyWords})}" class="page-top" target="mainFrame">首页</a></span>
			<span><a th:href="@{/blogmanagebypage(pageNum= ${pageInfo.hasPreviousPage}?${pageInfo.pageNum}:1,checkType=${checkType},keyWords=${keyWords})}" class="page-up" target="mainFrame">上一页</a></span>
			第&nbsp;<span th:text="${pageInfo.pageNum}" style="width: 15px">1</span>&nbsp;页
			<span><a th:href="@{/blogmanagebypage(pageNum= ${pageInfo.hasNextPage}?${pageInfo.pageNum}+1:${pageInfo.pages},checkType=${checkType},keyWords=${keyWords})}" class="page-down" target="mainFrame">下一页</a></span>
			<span><a th:href="@{/blogmanagebypage(pageNum= ${pageInfo.pages},checkType=${checkType},keyWords=${keyWords})}" class="page-bottom" target="mainFrame">尾页</a></span>
			共&nbsp;<span th:text="${pageInfo.pages}" style="width: 15px">2</span>&nbsp;页&nbsp;&nbsp;<span th:text="${pageInfo.size}" style="width: 15px">105</span>&nbsp;条数据
		</div>
		<div class="blog-new">
			<!--<span><a href="#" class="new-type" id="add">添加分类</a></span>-->
			<span style="margin-right: 30px;"><a th:href="@{/newblog}" class="new-blog">写博客</a></span>
		</div>
	</div>

</div>


<!-- -----新建分类----- -->
<!--<div class="type" id="window" style="display: none;">-->
	<!--<form action="#" method="POST">-->
		<!--分类名称：<input type="text" name="type" id="typename">-->
	<!--</form>-->
<!--</div>-->
</html>